<?php

$ruta=$_SERVER['DOCUMENT_ROOT']."/viventura"."/MDTour";
include_once("$ruta/conf/CConfig.php");
include_once("$ruta/MDTourGeneral/CDrawPageReg.php");

$i = $_POST['variable'];

echo "<div id='dashboard_info'>";

if($i==1){
    $operador = array("idOpe"=>"idOpe", "NamOpe"=>"NamOpe");
    CDrawPageReg::getInstance()->DrawSelectReload("operador", $operador, "Operador","servicio",$i);
}


if($i==2){
    $guide=array("idGuide"=>"idGuide","FirstNamGui"=>"FirstNamGui","LastNamGui"=>"LastNamGui");
    CDrawPageReg::getInstance()->DrawSelectReload("guidetc",$guide,"Guías","servicio");    
}

if($i==3){
    $restaurant=array("idRest"=>"idRest","NomRes"=>"NomRes");
    CDrawPageReg::getInstance()->DrawSelectReload("restaurant",$restaurant,"Restaurante","servicio");    
}

if($i==4){
    $transporte =array("idTrans"=>"idTrans","NamEmp"=>"NamEmp");
    CDrawPageReg::getInstance()->DrawSelectReload("transporte",$transporte,"Transporte","servicio");    
}

    echo "</div>";

echo "<div id='reload'></div>"

?>

<script language="javascript">
    
    function reload(){    
       /// Aqui podemos enviarle alguna variable a nuestro script PHP
       //document.write(select);
        var temp = <?php echo $i?>;
        var variable_post= document.getElementById("servicio").value;;
       /// Invocamos a nuestro script PHP
        $.post("servicios.php", {variable:variable_post,temp:temp}, function(data){
       /// Ponemos la respuesta de nuestro script en el DIV recargado
        $("#reload").html(data);
    });         
    }
</script>
        